﻿using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine.UI;

public class button : MonoBehaviour {
	
	[DllImport ("__Internal")]
	private static extern int ActivateUI_iOS(int index);
	int init = 0;
	// Use this for initialization
	void Start () {
		Button btn = gameObject.GetComponent<Button> ();
		btn.onClick.AddListener(delegate() {
			this.click(init);
//			init++;
	});
	}

	void click(int index){
		Debug.Log ("Mouse Click > "+index);
		if(Application.platform == RuntimePlatform.IPhonePlayer){
			int result = ActivateUI_iOS(index);
			init = result;
		}	
	}
	// Update is called once per frame
	void Update () {
	}
}
